package com.zuoye.day13;

import java.util.Objects;

public class Product {
    private String proName;
    private int proId;
    private float proPrice;
    private String proCity;

    public Product(){}
    public Product(String proName, int proId, float proPrice, String proCity) {
        this.proName = proName;
        this.proId = proId;
        this.proPrice = proPrice;
        this.proCity = proCity;
    }


    public String getProName() {
        return proName;
    }

    public void setProName(String proName) {
        this.proName = proName;
    }

    public int getProId() {
        return proId;
    }

    public void setProId(int proId) {
        this.proId = proId;
    }

    public float getProPrice() {
        return proPrice;
    }

    public void setProPrice(float proPrice) {
        this.proPrice = proPrice;
    }

    public String getProCity() {
        return proCity;
    }

    public void setProCity(String proCity) {
        this.proCity = proCity;
    }

    @Override
    public String toString() {
        return "Product{" +
                "proName='" + proName + '\'' +
                ", proId=" + proId +
                ", proPrice=" + proPrice +
                ", proCity='" + proCity + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Product product = (Product) o;
        return proId == product.proId && Objects.equals(proName, product.proName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(proName, proId);
    }
}
